<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no" />
  <title>首页</title>
  <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
</head>

<body>
  <canvas id="canvas" width="1000" height="1000"></canvas>

</body>

<script>
  // 找到画布
  let canvas = document.querySelector("#canvas")
  // 获取画笔
  let ctx = canvas.getContext('2d')
  // 起始点
  ctx.moveTo(0, 10)
  // 经过的坐标
  ctx.lineTo(50, 100)
  ctx.lineTo(90, 300)
  // 绘制路径
  ctx.strokeStyle = '#0f0' //边框颜色
  ctx.fillStyle = 'red' //背景色
  ctx.lineWidth = 5//边框粗细
  ctx.stroke()
  ctx.fill()
</script>

</html>